const CracoLessPlugin = require('craco-less');
 
module.exports = {
    babel:{
        presets:[
            [
                "@babel/preset-env",
                {
                    "targets":{
                        "chrome":"49",
                        "ios":"10"
                    }
                }
            ]
        ],
        plugins:[
            [
                "styled-components-px2rem",
                {
                    "rootValue":75
                }
            ]
        ]
    },
    plugins: [
        {
            plugin: CracoLessPlugin,
            options: {
                lessLoaderOptions: {
                    lessOptions: {
                        javascriptEnabled: true,
                    },
                },
            },
        },
    ],
    style: {
        postcss: {
            mode: 'extends',
            loaderOptions: {
                postcssOptions: {
                    ident: 'postcss',
                    plugins: [
                        [
                            'postcss-pxtorem',
                            {
                                rootValue: 75, // 根元素字体大小
                                propList: ['*']
                            },
                        ],
                    ],
                },
            },
        },
    },
};